import time
from selenium.webdriver.common.by import By
from week3_93.Page.Page1 import Page1

class Page3(Page1):
    buycar_loc = (By.XPATH, '/html/body/div[2]/div/div[2]/ul/li[3]/a')
    def buycar(self):
        self.click(self.buycar_loc)

    dy2_loc = (By.XPATH,'//*[@id="cart_container"]/div[2]/div[1]/div[1]')
    def dy2(self):
        return self.text(self.dy2_loc)

    delete_loc = (By.ID,'delChecked')
    def delete(self):
        self.click(self.delete_loc)

    ok_loc = (By.XPATH,'/html/body/div[5]/div/div[2]/div[3]/a[1]')
    def ok(self):
        self.click(self.ok_loc)

    def jiuxian_03(self):
        self.jiuxian_01()
        self.buycar()
        self.new_window()
        time.sleep(3)
        print("断言2:",self.dy2())
        assert "我的" in self.dy2()
        time.sleep(1)
        self.delete()
        self.ok()